package guoanmaker.operator.business.repository;

import java.util.List;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import guoanmaker.operator.business.model.MessageType;


public interface MessageTypeRepository  extends JpaRepository<MessageType, String>, JpaSpecificationExecutor<MessageType>{
	
	
	@Query("select m from MessageType m  where m.businessid=:businessid and m.isread != 1")
    List<MessageType>  findbyBusinessidAndIsreadNotEqual1(@Param("businessid") String businessid);
	
	@Query("select count(m.id) from MessageType m where m.businessid=:businessid and m.isread != 1")
	int  findByBusinessidNum(@Param("businessid") String businessid);

}
